package net.learn2develop.view;

import java.util.ArrayList;
import android.graphics.drawable.Drawable;
import com.google.android.maps.MapView;
import com.google.android.maps.OverlayItem;


public class MyItemizedOverlay extends BalloonItemizedOverlay<OverlayItem> {

	private ArrayList<OverlayItem> m_overlays = new ArrayList<OverlayItem>();
	
	public MyItemizedOverlay(Drawable defaultMarker, MapView mapView, String picHtml, Integer placeId) {
		super(boundCenter(defaultMarker), mapView, picHtml, placeId);
	}
		
	public void addOverlay(OverlayItem overlay) {
	    m_overlays.add(overlay);
	    populate();
	}

	@Override
	protected OverlayItem createItem(int i) {
		return m_overlays.get(i);
	}

	@Override
	public int size() {
		return m_overlays.size();
	}

	@Override
	protected boolean onBalloonTap(int index) {
		
		return true;
	}
	
}
